home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bprep110.zip / BPREP.DOC < prev    next >
Text File  |  1991-11-05  |  20KB  |  768 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                    BPREP
  16.  
  17.                 A preprocessor utility for the BASIC language
  18.  
  19.                                Version  1.10
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.        [c] 1991 Applied Design Group, E 3707 Pacific, Spokane, WA 99202
  51.  
  52.                                (509) 535-7829
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                         Table Of Contents
  59.                 ____________________________________
  60.  
  61.  
  62.             License Policy                              1
  63.  
  64.             Disclaimer                                  2
  65.  
  66.             Introduction                                3
  67.  
  68.             Compatibility                               4
  69.  
  70.             Where to reach us                           5
  71.  
  72.             Using BPREP                                 6
  73.  
  74.             The Directives                              7
  75.  
  76.                     #include                            8
  77.                     #define                             9
  78.                     #undef                             11
  79.                     #ifdef                             12
  80.                     #ifndef                            13
  81.                     #endif                             14
  82.  
  83.             Professional Version                       15
  84.  
  85.             Registration Information                   16
  86.  
  87.             Other Applied Design Group Products        17
  88.  
  89.             Order Form
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. License Policy:                                                 Page 1
  97.  
  98.  
  99.  
  100.      BPREP and its documentation are copyright [c] 1991 Applied Design Group
  101.      all rights reserved.  BPREP may not be circulated in any incomplete
  102.      or modified form, nor sold for profit, without written permission
  103.      of the author.  You may use the unregistered shareware version of
  104.      BPREP for a reasonable evaluation period.  After the evaluation
  105.      period, you must either register BPREP or discontinue its use.  If
  106.      you register BPREP, you may continue to use the unregistered BPREP
  107.      program until you receive the registered version.
  108.  
  109.  
  110.  
  111.      If you distribute this software to others, you are required to
  112.      distribute the ENTIRE package consisting of the following files:
  113.  
  114.                BPREP.EXE      -    BASIC Preprocessor
  115.                BPREP.DOC      -    BPREP Documentation
  116.                README         -    Read file
  117.                HISTORY        -    History of BPREP
  118.                SAMPLE.B       -    Sample source file
  119.                SAMPLE.INC     -    Sample include file
  120.                SAMPLE.BAS     -    Sample file processed with BPREP
  121.                BP.BAT         -    batch file to run BPREP
  122.  
  123.  
  124.  
  125.  
  126.  
  127. Commercial sale:
  128.  
  129.      Any software dealer or library may distribute the entire
  130.      BPREP Shareware package in an unmodified form for a fee as long as the
  131.      price charged for the disk containing BPREP Shareware does
  132.      not exceed US $10.00.
  133.  
  134.      With this single exception, the sale of BPREP or its parts for profit,
  135.      either alone or together with other software or hardware, requires a
  136.      licensing agreement providing for royalty payments.  Please write for
  137.      terms.
  138.  
  139.  
  140.  
  141. Disclaimer:                                                     Page 2
  142.  
  143.  
  144.  
  145.  
  146.  
  147.      This software (BPREP Shareware) is provided on an "as is" basis without
  148.  
  149.      warranty of any kind, expressed or implied, including but not limited
  150.  
  151.      to the implied warranties of merchantability and fitness for a
  152.  
  153.      particular purpose.  The person using the software bears all risk as to
  154.  
  155.      the quality and performance of the software.  Should the software
  156.  
  157.      prove defective, the user assumes the entire cost of all necessary
  158.  
  159.      repair, servicing, or correction.  The author will not be liable for
  160.  
  161.      any special, incidental, consequential, indirect or similar damages
  162.  
  163.      due to loss of data or any other reason, even if the author or an
  164.  
  165.      agent of the author has been advised of the possibility of such
  166.  
  167.      damages.  In no event shall the author's liability for any damages
  168.  
  169.      ever exceed the price paid for the license to use the software,
  170.  
  171.      regardless of the form of the claim.
  172.  
  173.  
  174.  
  175. Introduction                                                    Page 3
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. BPREP 1.10
  190.  
  191.  
  192.  
  193.  
  194. BPREP is a preprocessor for the BASIC language.  It adds features
  195.  
  196. usually lacking in most versions of BASIC.  With BPREP you can have
  197.  
  198. conditional compilation, include files and defined constants.  If you are
  199.  
  200. a C programmer you will probably recognize the syntax.  If you have never
  201.  
  202. used a preprocessor before you will soon be wondering how you ever got
  203.  
  204. along without one.  This is a shareware product,  you may try BPREP to see
  205.  
  206. if it fits your needs.  If after a reasonable period of time you find you
  207.  
  208. are still using BPREP you must register.  By registering this product
  209.  
  210. you will receive the professional version which includes many additional
  211.  
  212. features you will also recieve a printed manual, technical support and
  213.  
  214. a subscription to our quarterly newsletter for  one year.
  215.  
  216.  
  217. Alternatively you may register the version which you have at a lower
  218.  
  219. cost and recieve the printed manual and technical support.
  220.  
  221.  
  222.  
  223. Compatibility                                                   Page 4
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. BPREP can be used with almost any BASIC product that can take input from
  231.  
  232. a normal ascii file.  This includes but is not limited to the following.
  233.  
  234.  
  235.  
  236.  
  237.                         Turbo Basic
  238.  
  239.                         QuickBasic   3.0
  240.  
  241.                         QuickBasic   4.0
  242.  
  243.                         QuickBasic   4.5
  244.  
  245.                         Power Basic
  246.  
  247.                         GW Basic
  248.  
  249.                         MEQ Basic    (Mars Electronics)
  250.  
  251.                         Intel MCS BASIC 52
  252.  
  253.  
  254.  
  255. If there is a question of compatibility just drop us a line or call
  256.  
  257. 8:00 AM to 5:00 PM Pacific Time.
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                         Applied Design Group
  264.                            (509) 535-7829
  265.  
  266.  
  267.  
  268. Where to Reach us                                               Page 5
  269.  
  270.  
  271.  
  272. The author "Daryl Posnett" can be reached directly at this number
  273.  
  274.  
  275.  
  276.                         Applied Design Group
  277.                            (509) 535-7829
  278.  
  279.  
  280.  
  281. or electronically at one of the following BBS systems:
  282.  
  283.  
  284.                            Local BBS's
  285.                            -----------
  286.  
  287.         SMUG (Spokane Microcomputer User's Group)  (509) 534-1590
  288.         IEA  (Inland Empire Archive)               (509) 624-6799
  289.         ThinkTank                  (509) 244-6446
  290.  
  291.  
  292.  
  293.  
  294.                          Non-Local BBS's
  295.                          ---------------
  296.  
  297.         Mars Electronics           (215) 430-7165
  298.         Circuit Cellar Ink                  (203) 871-1988
  299.  
  300.  
  301.  
  302. The latest version of BPREP and other Applied Design Group products
  303.  
  304. can alse be found on these bbs systems.  Although it is not the
  305.  
  306. prefered method of reaching us, the authors compuserve ID is
  307.  
  308.                         70540,1756.
  309.  
  310. If contacting us via a local bbs your questions will be answered in a
  311.  
  312. day or so, otherwise it may take as much as a week or more.
  313.  
  314.  
  315.  
  316.  
  317. Using BPREP                                                     Page 6
  318.  
  319.  
  320. BPREP takes two arguments from the command line, an input file name and
  321. an output file name.  We suggest using  "B" as an extension for your
  322. source files and "BAS" for the output files, although anything will work
  323.  
  324.  
  325.         ie:
  326.  
  327.                     BPREP myfile.b myfile.bas
  328.  
  329.  
  330.                     myfile.b :
  331.  
  332.                         #define SUM 3+4
  333.                         print SUM
  334.  
  335.  
  336.                     myfile.bas
  337.  
  338.                         print 3+4
  339.  
  340.  
  341.  
  342. so the command line syntax is
  343.  
  344.     BPREP infile outfile
  345.  
  346.  
  347. if you leave off the outfile name BPREP will write to the screen, useful
  348. to see what's going on.
  349.  
  350. #defined names must start with a letter and can consist of numbers,
  351. letters and the underscore "_" character.  Length of names is limited by
  352. memory and common sense.
  353.  
  354.                         Valid names
  355.                         -----------
  356.  
  357.                         TEST_1
  358.                         Version1
  359.                         Version_1_2_3
  360.                         DISTRIB
  361.                         Abcdefgjijklmnopqrstuvwxyz1234567890_____________
  362.  
  363.  
  364.  
  365.                                                                 Page 7
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.                              The Directives
  376.  
  377.  
  378.  
  379.             BPREP shareware supports the following directives:
  380.  
  381.  
  382.                                 #include
  383.                                 #define
  384.                                 #undef
  385.                                 #ifdef
  386.                                 #ifndef
  387.                                 #endif
  388.  
  389.  
  390.  
  391. #include                                                        Page 8
  392.  
  393. SYNTAX      :  #include myfile.inc
  394.  
  395. OPERATION   :  The #include directive does not allow quotes around the file
  396.  
  397.                The included file will be opened and processed and can
  398.                include preprocessor directives.  The ouput will be a single
  399.                combined file of all included files.   Include files can
  400.                be nested to a depth of 4 in the SHAREWARE version. In the
  401.                PROFESSIONAL version the number of include files  is
  402.                limited only by available memory and disk space.
  403.  
  404.  
  405.  
  406.  
  407. #define                                                         Page 9
  408.  
  409. SYNTAX      :  #define name definition
  410.  
  411. OPERATION   :  The define directive allows you to replace constants with
  412.                meaningful symbolic names and to define symbols to be
  413.                used with the conditional compilation directives (see
  414.                below).  The name can be any legal basic variable name
  415.                although we suggest using upper case names for defined
  416.                constants and lower and uppercase mixture or lowercase
  417.                only for variables. ie
  418.  
  419.                         #define COMM_PORT 1000
  420.  
  421.                         current_comm_port = COMM_PORT
  422.  
  423.                In the shareware version of BPREP definitions are limited
  424.                to string constants so the following:
  425.  
  426.                             #define SUM 3+4
  427.  
  428.                             sumvar = SUM + 6
  429.  
  430.                      will translate to:
  431.  
  432.                             sumvar = 3+4 + 6
  433.  
  434.  
  435.                 Any text in string literals or comments is left
  436.                 completely intact:
  437.  
  438.                         #define DEFINE "#define"
  439.                         print DEFINE
  440.  
  441.                 becomes:
  442.                         print "#define"
  443.  
  444.  
  445.  
  446.                                                                 Page 10
  447.  
  448.  
  449.                 Names cannot be defined twice to change the value of a
  450.                 #define'd name #undef it first.
  451.  
  452.                         #define SUM 3+4
  453.                         #define SUM 4+5     --- ERROR
  454.  
  455.                         #define SUM 3+4
  456.                         #undef  SUM
  457.                         #define SUM 4+5     --- OK
  458.  
  459.  
  460.                 Names can be used in the expression of a #define
  461.                 statement.
  462.  
  463.                 ie:
  464.                         #define  FIRSTNAME "John"
  465.                         #define  LASTNAME  "Smith"
  466.  
  467.                         #define  NAME    FIRSTNAME + " " + LASTNAME
  468.  
  469.                         name$ =  NAME
  470.  
  471.                 becomes:
  472.  
  473.                         name$ =  "John"+" "+"Smith"
  474.  
  475.  
  476.  
  477.                 If constant expression evaluation is a feature you
  478.                 would like to have then consider purchasing the
  479.                 professional version.
  480.  
  481.                 ie:  (in the PROFESSIONAL VERSION ONLY )
  482.  
  483.                         #define SUM 3+4
  484.                         var = SUM       : becomes var = 7
  485.  
  486.  
  487.  
  488. #undef                                                          Page 11
  489.  
  490. SYNTAX      :  #undef name
  491.  
  492. OPERATION   :  The name is removed from the symbol table further
  493.                references to the name will be ignored.  Use the
  494.                #undef directive to redefine a #defined'd name.
  495.  
  496.  
  497. #ifdef                                                          Page 12
  498.  
  499. SYNTAX      :  #ifdef name
  500.                 ...
  501.                 ...
  502.  
  503.                #endif
  504.  
  505.  
  506. OPERATION   :  The #ifdef directive is used for conditional compilation
  507.                if the name is found the code up until the #endif
  508.                directive is emmitted to the output file, if the symbol
  509.                is not found then no code is emmitted until the #endif is
  510.                reached.
  511.  
  512.  
  513.                example:
  514.  
  515.                         #define VER1
  516.  
  517.                         #ifdef VER1
  518.                             print "My Program Ver 1.0"
  519.                         #endif
  520.  
  521.                         #ifdef VER2
  522.                             print "My Program Ver 2.0"
  523.                         #endif
  524.  
  525.                output:
  526.                         My Program Ver 1.0
  527.  
  528.  
  529.               The shareware version allows #ifdef's and #ifndefs
  530.               to be nested to 8 levels
  531.  
  532.               ie:
  533.                         #ifdef VER1
  534.                         #ifdef UPDATE1
  535.                             print "My Program Ver 1.0 update 1.0"
  536.  
  537.                         #endif
  538.                         #endif
  539.  
  540.  
  541.               if deeper nesting is required the professional version
  542.               allows virtually unlimited nesting.
  543.  
  544.  
  545. #ifndef                                                         Page 13
  546.  
  547. SYNTAX      :  #ifndef name
  548.                 ...
  549.                 ...
  550.  
  551.                #endif
  552.  
  553.  
  554. OPERATION   :  The #ifndef directive is used for conditional compilation
  555.                if the name is not found the code up until the #endif
  556.                directive is emmitted to the output file, if the symbol
  557.                is found then no code is emmitted until the #endif is
  558.                reached.
  559.  
  560.  
  561.  
  562. #endif                                                          Page 14
  563.  
  564. SYNTAX      :  #endif
  565.  
  566. OPERATION   :  #endif terminates an #ifdef or #ifndef block
  567.  
  568.  
  569.  
  570.  
  571. Professional Version                                            Page 15
  572.  
  573.  
  574.  
  575.  
  576.  
  577. The professional version includes the following additional features:
  578.  
  579.  
  580.  
  581.  
  582.  
  583.   Constant expression evaluation : defines can be arithmetic expressions
  584.                                    as well as strings.
  585.  
  586.  
  587.   Nested conditional directives  : unlimited nesting of   #ifdef,
  588.                                    #ifndef, etc.
  589.  
  590.  
  591.   Case sensitivity switch, case sensitive code generation.
  592.  
  593.  
  594.  
  595.   Line number generation for line number basics.
  596.  
  597.  
  598.  
  599.   The following additional directives:
  600.  
  601.                             #if
  602.                             #else
  603.                             #elseif
  604.                             #repeat
  605.                             #macro
  606.                             #endm
  607.                             #local
  608.                             #display
  609.                             #error
  610.                             #fatal
  611.                             #date
  612.                             #time
  613.                             #conds
  614.                             #noconds
  615.                             #defs
  616.                             #nodefs
  617.  
  618.  
  619. Registration Information                                        Page 16
  620.  
  621.  
  622.  
  623.  
  624.  
  625.         BPREP is NOT FREE Software.  If you wish to continue using BPREP
  626.         you must register.
  627.  
  628.  
  629.  
  630.  
  631.  
  632.         Q : What do I get if I register ?
  633.  
  634.         A : BPREP Shareware is a complete and usable program as is
  635.             however, by registering you will recieve the latest version
  636.             of BPREP Professional the enhanced BASIC Preprocessor which
  637.             includes many additional features not found in
  638.             BPREP Shareware.  So this is what you will recieve
  639.  
  640.  
  641.                         - BPREP Professional on disk
  642.                         - A Printed manual
  643.                         - Unlimited Technical Support
  644.                         - Quarterly Newsletter
  645.                                (for 1 year)
  646.  
  647.                                                              $24.95
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.         Q : I'd like to register for the technical support and manual
  655.             but  I don't need the power of BPREP Professional.
  656.  
  657.         A : You can register your copy of BPREP Shareware and receive
  658.             the printed manual and technical support for only:
  659.  
  660.                                                               $9.95.
  661.  
  662.  
  663.  
  664.  
  665. Other Applied Design Group Products                             Page 17
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672. ASM51 8051/8031 Macro Cross Assembler
  673.  
  674.         A full featured Cross Assembler for the Intel 8051/8031
  675.         series of microprocessors.  Generates Intel HEX files or
  676.         binary image output.
  677.                                                          $39.95
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685. BAS51 8051/8031 Basic Cross Compiler
  686.  
  687.         A BASIC compiler for the 8051 that supports most features
  688.         of the BASIC language.  Use structured contstructs
  689.         while/wend, do/loop, block if/then.  Generates good tight
  690.         code and no line numbers are required. Get those 8051
  691.         projects done in less time.
  692.  
  693.                                                          $99.95
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700. BAS51 Professional
  701.  
  702.         A complete package including BAS51 Compiler, ASM51 Assembler
  703.         and BPREP Professional, as well as several other utilities to
  704.         help you write 8051 code.
  705.                                                         $149.95
  706.  
  707.  
  708.  
  709.  
  710.    BPREP version 1.10                                     Order Form
  711.    -----------------------------------------------------------------
  712.      Make checks payable to:
  713.        Applied Design Group
  714.        E 3707 Pacific
  715.        Spokane, WA 99202
  716.    -----------------------------------------------------------------
  717.    Qty
  718.  
  719.    [ ] BPREP Shareware                   @   $9.95 each      $______
  720.  
  721.    [ ] BPREP Professional                @  $24.95 each      $______
  722.  
  723.    [ ] ASM51
  724.        8051/8031 Macro Cross Assembler   @  $39.95 each      $______
  725.  
  726.    [ ] BAS51
  727.        8051/8031 Basic Cross Compiler    @  $99.95 each      $______
  728.  
  729.    [ ] BAS51 Professional
  730.        8051/8031 Basic Cross Compiler
  731.        Includes Macro Assembler
  732.        and BPREP Professional            @ $149.95 each      $______
  733.  
  734.                                                 Subtotal     $______
  735.  
  736.        Washington residents please add 8.0% sales tax.       $______
  737.  
  738.        Shipping and handling                                   $3.50
  739.  
  740.                                                      Total   $______
  741.  
  742.        Diskette type :  [ ] 5.25"         [ ] 3.5"
  743.  
  744.        Payment       :  [ ] Check         [ ] Money Order
  745.  
  746.    Checks and Money Orders must be drawn on U.S. banks in U.S. funds
  747.    -----------------------------------------------------------------
  748.  
  749.    Name      _______________________________________________________
  750.  
  751.    Company   _______________________________________________________
  752.  
  753.    Address   _______________________________________________________
  754.  
  755.              _______________________________________________________
  756.  
  757.    Phone     _____________________  Business  ______________________
  758.  
  759.  
  760.    Where did you obtain BPREP?
  761.  
  762.              _______________________________________________________
  763.  
  764.    Comments  _______________________________________________________
  765.  
  766.              _______________________________________________________
  767.  
  768.